﻿namespace MicroCloud.Entity.Oracle
{
    /// <summary>
    /// Oracle-DbContext迁移模块基类
    /// </summary>
    /// <typeparam name="TDbContext">数据上下文类型</typeparam>
    [DependsOnPacks(typeof(OracleEntityFrameworkCorePack))]
    [Description("Oracle-DbContext迁移模块")]
    public abstract class OracleDbContextMigrationPackBase<TDbContext> : MigrationPackBase<TDbContext>
        where TDbContext : DbContext, IDbContext
    {
        #region 属性
        /// <summary>
        /// 获取 数据库类型
        /// </summary>
        protected override DatabaseType DatabaseType => DatabaseType.Oracle;

        #endregion

        /// <summary>
        /// 重写实现获取数据上下文实例
        /// </summary>
        /// <param name="scopedProvider">服务提供者</param>
        /// <returns></returns>
        protected override TDbContext CreateDbContext(IServiceProvider scopedProvider)
        {
            return new DesignTimeDbContextFactory<TDbContext>(scopedProvider).CreateDbContext(Array.Empty<string>());
        }

    }
}